package com.base.common.persistent.dao;

import com.base.common.persistent.model.Employee;
import com.base.common.persistent.model.Terminal;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {

	/**
	 * 员工登录
	 * 
	 * @param code
	 * @param phone
	 * @return
	 */
	List employeeLogin(Terminal terminal);
	
	/**
	 * 根据id获取员工信息
	 * 
	 * @param employeeId
	 * @return
	 */
	List<Employee> queryEmployeeAndPermissionById(@Param(value = "employeeId") int employeeId);

	/**
	 * 根据id查询员工信息
	 * 
	 * @param id
	 * @return
	 */
	Employee queryEmployeeById(@Param(value = "id") int id);
	
	/**
	 * 根据手机号查询员工信息个数
	 * 
	 * @param phone
	 * @return
	 */
	List<Employee> queryEmployeeByPhone(@Param(value = "phone") String phone);

	/**
	 * 根据职位和小区id查询员工列表
	 * 
	 * @param employee
	 * @return
	 */
	List<Employee> queryEmployeesByDeptAndCompoundsId(@Param(value = "dept") int dept,
													  @Param(value = "compoundsId") int compoundsId);
	
	/**
	 * 更新员工默认小区
	 * 
	 * @param employeeId
	 * @param compoundsId
	 * @return
	 */
	int updateChooseDefaultCompounds(int employeeId, int compoundsId);

	/**
	 * 根据员工id更新员工信息的终端外键
	 * 
	 * @param employeeId
	 * @param terminalId
	 * @return
	 */
	int updateEmployeeTerminalInfoById(@Param(value = "employeeId") int employeeId, @Param(value = "terminalId") int terminalId);

}
